package com.lvbey.controller;


import com.lvbey.api.HelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/hello")
public class HelloController {
    @Autowired
    private HelloService helloService;


    public HelloController() {
        System.out.println("初始化 HelloController");
    }

    @RequestMapping("/world")
    public String world() {
        return "hello world";
    }

    @RequestMapping("/save")
    public String save() {
        return helloService.insert() ? "true" : "false";
    }
}
